#include "ogl/gut/Animation.h"
#include "ogl/gut/Dictionary.h"
#include "imgui/Editor.h"

using namespace Ogl::Gut;

template <>
bool ImGui::Editor::Edit(const std::string &label, Ogl::Gut::AnimationDesc1 &inst)
{
    int index = 0;

    if (Editor::TreeNode(label.c_str(), inst.m_BitFlag, index++))
    {

        EditInst<std::string >("path", inst.m_Path);
        EditInst<unsigned int>("index", inst.m_Index);
    
        TreePop();
    }

    return false;
}

template <>
bool ImGui::Editor::Edit(const std::string &label, Ogl::Gut::AnimationDesc &inst)
{
    int index = 0;

    if (Editor::TreeNode(label.c_str(), inst.m_BitFlag, index))
    {
        ComboInst<AnimationDescType, AnimationDescTypeDesc>("DescType", Dictionary::m_AnimationDescTypeDescs, inst.m_Type);
        EditInst<AnimationDesc1>("desc1", inst.m_Desc1);
        TreePop();
    }
    return false;
}


template <>
bool ImGui::Editor::Edit(const std::string &label, Ogl::Gut::Animation &inst)
{
    int index = 0;
    if (Editor::TreeNode(label.c_str(), inst.m_BitFlag ,index))
    {
        EditInst<AnimationDesc>("desc ", inst.m_Desc);
        ImGui::TreePop();
    }
    return false;
}
